<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head th:replace="~{common/header :: commonHead}"><title></title></head>
<script src="/js/plugins/echarts/echarts-all.js"></script>
<body class="gray-bg">
<!--style="background: url('/img/20190514195350.png');background-repeat: no-repeat;"-->
<!--<div class="wrapper wrapper-content" style="background: url('/img/20190514195350.png');background-repeat: no-repeat;">-->
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>会员</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins" th:text="${editable.getUserNum()} + '人'"></h1>
                    <small>会员总数</small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>积分入账</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins" th:text="${editable.getUserCentNum()}"></h1>
                    <small>用户获取积分总额</small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>积分消费</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins" th:text="${editable.getUserCentOutNum()}"></h1>
                    <small>用户消费积分总额</small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>积分总数</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins" th:text="${editable.getUserSumIntergral()}"></h1>
                    <small>积分产生、消费总和</small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>积分小票消费总额</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins" th:text="${#numbers.formatDecimal(editable.getMoney(),0,2) + '元'}"></h1>
                    <small th:text="${editable.getIntegralNum() + '笔'}"></small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>签到总次数</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins" th:text="${editable.getSigninNum() + '次'}"></h1>
                    <small>会员签到总次数</small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>优惠券领取数量</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins" th:text="${editable.getCouponNum() + '张'}"></h1>
                    <small>优惠券领取数量</small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>优惠券使用总量</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins" th:text="${editable.getCouponUseNum() + '张'}"></h1>
                    <small>优惠券使用总量</small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>停车券领取总量</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins" th:text="${editable.getParkingCouponNum() + '张'}"></h1>
                    <small>停车券领取总量</small>
                </div>
            </div>
        </div>
        <div class="col-sm-3">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>停车券使用总量</h5>
                </div>
                <div class="ibox-content">
                    <h1 class="no-margins" th:text="${editable.getParkingCouponUseNum() + '张'}"></h1>
                    <small>停车券使用总量</small>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>新增用户统计</h5>
                </div>
                <div class="ibox-content">
                    <div>
                        <div id="user-main" class="echarts blh-chart" style="width: 100%;height:300px;"></div>
                        <div style="text-align: center;width: 100%">
                            <div class="btn-group">
                                <button onclick="changeTime('year',$(this),1,'user-main')" class="btn btn-xs btn-white">年</button>
                                <button onclick="changeTime('month',$(this),1,'user-main')" class="btn btn-xs btn btn-primary" disabled>月</button>
                                <button onclick="changeTime('week',$(this),1,'user-main')" class="btn btn-xs btn btn-white">周</button>
                                <button onclick="changeTime('daily',$(this),1,'user-main')" class="btn btn-xs btn btn-white">日</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>积分获取统计</h5>
                </div>
                <div class="ibox-content">
                    <div>
                        <div id="int-main-get" class="echarts blh-chart" style="width: 100%;height:300px;"></div>
                        <div style="text-align: center;width: 100%">
                            <div class="btn-group">
                                <button onclick="changeTime('year',$(this),2,'int-main-get')" class="btn btn-xs btn-white">年</button>
                                <button onclick="changeTime('month',$(this),2,'int-main-get')" class="btn btn-xs btn btn-primary" disabled>月</button>
                                <button onclick="changeTime('week',$(this),2,'int-main-get')" class="btn btn-xs btn btn-white">周</button>
                                <button onclick="changeTime('daily',$(this),2,'int-main-get')" class="btn btn-xs btn btn-white">日</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>积分消费统计</h5>
                </div>
                <div class="ibox-content">
                    <div>
                        <div id="int-main-consume" class="echarts blh-chart" style="width: 100%;height:300px;"></div>
                        <div style="text-align: center;width: 100%">
                            <div class="btn-group">
                                <button onclick="changeTime('year',$(this),3,'int-main-consume')" class="btn btn-xs btn-white">年</button>
                                <button onclick="changeTime('month',$(this),3,'int-main-consume')" class="btn btn-xs btn btn-primary" disabled>月</button>
                                <button onclick="changeTime('week',$(this),3,'int-main-consume')" class="btn btn-xs btn btn-white">周</button>
                                <button onclick="changeTime('daily',$(this),3,'int-main-consume')" class="btn btn-xs btn btn-white">日</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>积分小票消费笔数</h5>
                </div>
                <div class="ibox-content">
                    <div>
                        <div id="self-int-time" class="echarts blh-chart" style="width: 100%;height:300px;"></div>
                        <div style="text-align: center;width: 100%">
                            <div class="btn-group">
                                <button onclick="changeTime('year',$(this),4,'self-int-time')" class="btn btn-xs btn-white">年</button>
                                <button onclick="changeTime('month',$(this),4,'self-int-time')" class="btn btn-xs btn btn-primary" disabled>月</button>
                                <button onclick="changeTime('week',$(this),4,'self-int-time')" class="btn btn-xs btn btn-white">周</button>
                                <button onclick="changeTime('daily',$(this),4,'self-int-time')" class="btn btn-xs btn btn-white">日</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>积分小票金额</h5>
                </div>
                <div class="ibox-content">
                    <div>
                        <div id="self-int-money" class="echarts blh-chart" style="width: 100%;height:300px;"></div>
                        <div style="text-align: center;width: 100%">
                            <div class="btn-group">
                                <button onclick="changeTime('year',$(this),5,'self-int-money')" class="btn btn-xs btn-white">年</button>
                                <button onclick="changeTime('month',$(this),5,'self-int-money')" class="btn btn-xs btn btn-primary" disabled>月</button>
                                <button onclick="changeTime('week',$(this),5,'self-int-money')" class="btn btn-xs btn btn-white">周</button>
                                <button onclick="changeTime('daily',$(this),5,'self-int-money')" class="btn btn-xs btn btn-white">日</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>小票积分总计</h5>
                </div>
                <div class="ibox-content">
                    <div>
                        <div id="self-int-total" class="echarts blh-chart" style="width: 100%;height:300px;"></div>
                        <div style="text-align: center;width: 100%">
                            <div class="btn-group">
                                <button onclick="changeTime('year',$(this),6,'self-int-total')" class="btn btn-xs btn-white">年</button>
                                <button onclick="changeTime('month',$(this),6,'self-int-total')" class="btn btn-xs btn btn-primary" disabled>月</button>
                                <button onclick="changeTime('week',$(this),6,'self-int-total')" class="btn btn-xs btn btn-white">周</button>
                                <button onclick="changeTime('daily',$(this),6,'self-int-total')" class="btn btn-xs btn btn-white">日</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>小票积分笔数商铺</h5>
                </div>
                <div class="ibox-content">
                    <div>
                        <div id="store-int-time" class="echarts blh-chart" style="width: 100%;height:300px;"></div>
                        <div style="text-align: center;width: 100%">
                            <div class="btn-group">
                                <button onclick="changeTime('year',$(this),7,'store-int-time')" class="btn btn-xs btn-white">年</button>
                                <button onclick="changeTime('month',$(this),7,'store-int-time')" class="btn btn-xs btn btn-primary" disabled>月</button>
                                <button onclick="changeTime('week',$(this),7,'store-int-time')" class="btn btn-xs btn btn-white">周</button>
                                <button onclick="changeTime('daily',$(this),7,'store-int-time')" class="btn btn-xs btn btn-white">日</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>小票积分商铺</h5>
                </div>
                <div class="ibox-content">
                    <div>
                        <div id="store-int-total" class="echarts blh-chart" style="width: 100%;height:300px;"></div>
                        <div style="text-align: center;width: 100%">
                            <div class="btn-group">
                                <button onclick="changeTime('year',$(this),8,'store-int-total')" class="btn btn-xs btn-white">年</button>
                                <button onclick="changeTime('month',$(this),8,'store-int-total')" class="btn btn-xs btn btn-primary" disabled>月</button>
                                <button onclick="changeTime('week',$(this),8,'store-int-total')" class="btn btn-xs btn btn-white">周</button>
                                <button onclick="changeTime('daily',$(this),8,'store-int-total')" class="btn btn-xs btn btn-white">日</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>小票金额商铺</h5>
                </div>
                <div class="ibox-content">
                    <div>
                        <div id="store-int-money" class="echarts blh-chart" style="width: 100%;height:300px;"></div>
                        <div style="text-align: center;width: 100%">
                            <div class="btn-group">
                                <button onclick="changeTime('year',$(this),9,'store-int-money')" class="btn btn-xs btn-white">年</button>
                                <button onclick="changeTime('month',$(this),9,'store-int-money')" class="btn btn-xs btn btn-primary" disabled>月</button>
                                <button onclick="changeTime('week',$(this),9,'store-int-money')" class="btn btn-xs btn btn-white">周</button>
                                <button onclick="changeTime('daily',$(this),9,'store-int-money')" class="btn btn-xs btn btn-white">日</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>优惠券领取总量</h5>
                </div>
                <div class="ibox-content">
                    <div>
                        <div id="store-coup-add" class="echarts blh-chart" style="width: 100%;height:300px;"></div>
                        <div style="text-align: center;width: 100%">
                            <div class="btn-group">
                                <button onclick="changeTime('year',$(this),10,'store-coup-add')" class="btn btn-xs btn-white">年</button>
                                <button onclick="changeTime('month',$(this),10,'store-coup-add')" class="btn btn-xs btn btn-primary" disabled>月</button>
                                <button onclick="changeTime('week',$(this),10,'store-coup-add')" class="btn btn-xs btn btn-white">周</button>
                                <button onclick="changeTime('daily',$(this),10,'store-coup-add')" class="btn btn-xs btn btn-white">日</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>优惠券使用总量</h5>
                </div>
                <div class="ibox-content">
                    <div>
                        <div id="store-coup-use" class="echarts blh-chart" style="width: 100%;height:300px;"></div>
                        <div style="text-align: center;width: 100%">
                            <div class="btn-group">
                                <button onclick="changeTime('year',$(this),11,'store-coup-use')" class="btn btn-xs btn-white">年</button>
                                <button onclick="changeTime('month',$(this),11,'store-coup-use')" class="btn btn-xs btn btn-primary" disabled>月</button>
                                <button onclick="changeTime('week',$(this),11,'store-coup-use')" class="btn btn-xs btn btn-white">周</button>
                                <button onclick="changeTime('daily',$(this),11,'store-coup-use')" class="btn btn-xs btn btn-white">日</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>停车券领取总量</h5>
                </div>
                <div class="ibox-content">
                    <div>
                        <div id="store-park-add" class="echarts blh-chart" style="width: 100%;height:300px;"></div>
                        <div style="text-align: center;width: 100%">
                            <div class="btn-group">
                                <button onclick="changeTime('year',$(this),12,'store-park-add')" class="btn btn-xs btn-white">年</button>
                                <button onclick="changeTime('month',$(this),12,'store-park-add')" class="btn btn-xs btn btn-primary" disabled>月</button>
                                <button onclick="changeTime('week',$(this),12,'store-park-add')" class="btn btn-xs btn btn-white">周</button>
                                <button onclick="changeTime('daily',$(this),12,'store-park-add')" class="btn btn-xs btn btn-white">日</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>停车券使用总量</h5>
                </div>
                <div class="ibox-content">
                    <div>
                        <div id="store-park-use" class="echarts blh-chart" style="width: 100%;height:300px;"></div>
                        <div style="text-align: center;width: 100%">
                            <div class="btn-group">
                                <button onclick="changeTime('year',$(this),13,'store-park-use')" class="btn btn-xs btn-white">年</button>
                                <button onclick="changeTime('month',$(this),13,'store-park-use')" class="btn btn-xs btn btn-primary" disabled>月</button>
                                <button onclick="changeTime('week',$(this),13,'store-park-use')" class="btn btn-xs btn btn-white">周</button>
                                <button onclick="changeTime('daily',$(this),13,'store-park-use')" class="btn btn-xs btn btn-white">日</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>停车汇总</h5>
                </div>
                <div class="ibox-content">
                    <div>
                        <div id="parking-num" class="echarts blh-chart" style="width: 100%;height:300px;"></div>
                        <div style="text-align: center;width: 100%">
                            <div class="btn-group">
                                <button onclick="changeTime('year',$(this),14,'parking-num')" class="btn btn-xs btn-white">年</button>
                                <button onclick="changeTime('month',$(this),14,'parking-num')" class="btn btn-xs btn btn-primary" disabled>月</button>
                                <button onclick="changeTime('week',$(this),14,'parking-num')" class="btn btn-xs btn btn-white">周</button>
                                <button onclick="changeTime('daily',$(this),14,'parking-num')" class="btn btn-xs btn btn-white">日</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>停车缴费曲线</h5>
                </div>
                <div class="ibox-content">
                    <div>
                        <div id="parking-fee" class="echarts blh-chart" style="width: 100%;height:300px;"></div>
                        <div style="text-align: center;width: 100%">
                            <div class="btn-group">
                                <button onclick="changeTime('year',$(this),15,'parking-fee')" class="btn btn-xs btn-white">年</button>
                                <button onclick="changeTime('month',$(this),15,'parking-fee')" class="btn btn-xs btn btn-primary" disabled>月</button>
                                <button onclick="changeTime('week',$(this),15,'parking-fee')" class="btn btn-xs btn btn-white">周</button>
                                <button onclick="changeTime('daily',$(this),15,'parking-fee')" class="btn btn-xs btn btn-white">日</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-sm-6">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>签到汇总</h5>
                </div>
                <div class="ibox-content">
                    <div>
                        <div id="sign-num" class="echarts blh-chart" style="width: 100%;height:300px;"></div>
                        <div style="text-align: center;width: 100%">
                            <div class="btn-group">
                                <button onclick="changeTime('year',$(this),16,'sign-num')" class="btn btn-xs btn-white">年</button>
                                <button onclick="changeTime('month',$(this),16,'sign-num')" class="btn btn-xs btn btn-primary" disabled>月</button>
                                <button onclick="changeTime('week',$(this),16,'sign-num')" class="btn btn-xs btn btn-white">周</button>
                                <button onclick="changeTime('daily',$(this),16,'sign-num')" class="btn btn-xs btn btn-white">日</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="jvectormap-label"></div></body>

<script th:inline="javascript">

    let domain = [[${ipDomain}]];

    let url1 = domain + '/quanquan-user/statistical_user/user_new'
    let url2 = domain + '/quanquan-user/statistical_integral/integral_receive'
    let url3 = domain + '/quanquan-user/statistical_integral/integral_consume'
    let url4 = domain + '/quanquan-user/statistical_self_help/receipts_total'
    let url5 = domain + '/quanquan-user/statistical_self_help/amount_total'
    let url6 = domain + '/quanquan-user/statistical_self_help/integral_total'
    let url7 = domain + '/quanquan-user/store_consume_ranking/number'
    let url8 = domain + '/quanquan-user/store_consume_ranking/integral'
    let url9 = domain + '/quanquan-user/store_consume_ranking/money'
    let url10 = domain + '/quanquan-store/coupon_num/coupon_add_num'
    let url11 = domain + '/quanquan-store/coupon_num/coupon_use_num'
    let url12 = domain + '/quanquan-store/coupon_num/parking_coupon_add_num'
    let url13 = domain + '/quanquan-store/coupon_num/parking_coupon_use_num'
    let url14 = domain + '/quanquan-parking/parking_num/parking_num'
    let url15 = domain + '/quanquan-parking/parking_num/parking_fee_num'
    let url16 = domain + '/quanquan-user/signin_num/signin_num'

    let USER_TIME = 'month';
    setData(USER_TIME,url1,'user-main','用户数',null,'line','新增用户');
    setData(USER_TIME,url2,'int-main-get','积分',null,'bar','积分获取');
    setData(USER_TIME,url3,'int-main-consume','积分',null,'bar','积分消费');
    setData(USER_TIME,url4,'self-int-time','笔',null,'bar','消费笔数');
    setData(USER_TIME,url5,'self-int-money','元',null,'bar','小票金额');
    setData(USER_TIME,url6,'self-int-total','积分',null,'bar','积分总额');
    setData(USER_TIME,url7,'store-int-time','笔',null,'bar','商铺消费笔数');
    setData(USER_TIME,url8,'store-int-total','积分',null,'bar','商铺消费积分');
    setData(USER_TIME,url9,'store-int-money','元',null,'bar','商铺消费总金额');
    setData(USER_TIME,url10,'store-coup-add','张',null,'bar','领取优惠券数量');
    setData(USER_TIME,url11,'store-coup-use','张',null,'bar','优惠券使用数量');
    setData(USER_TIME,url12,'store-park-add','张',null,'bar','领取停车券数量');
    setData(USER_TIME,url13,'store-park-use','张',null,'bar','停车券使用数量');
    setData(USER_TIME,url14,'parking-num','次',null,'bar','停车车次');
    setData(USER_TIME,url15,'parking-fee','元',null,'line','停车缴费');
    setData(USER_TIME,url16,'sign-num','次',null,'line','签到曲线');

    function changeTime(time,e,type,container) {
        USER_TIME = time;
        let url = '';
        let unity = '';
        let disType = '';
        let disName = '';
        switch (type) {
            case 1:
                url = url1;
                unity = '用户数';
                disType = 'line';
                disName = '新增用户';
                break;
            case 2:
                url = url2;
                unity = '积分';
                disType = 'bar';
                disName = '积分获取';
                break;
            case 3:
                url = url3;
                unity = '积分';
                disType = 'bar';
                disName = '积分消费';
                break;
            case 4:
                url = url4;
                unity = '笔';
                disType = 'bar';
                disName = '消费笔数';
                break;
            case 5:
                url = url5;
                unity = '元';
                disType = 'bar';
                disName = '小票金额';
                break;
            case 6:
                url = url6;
                unity = '积分';
                disType = 'bar';
                disName = '积分总额';
                break;
            case 7:
                url = url7;
                unity = '笔';
                disType = 'bar';
                disName = '商铺消费笔数';
                break;
            case 8:
                url = url8;
                unity = '积分';
                disType = 'bar';
                disName = '商铺消费积分';
                break;
            case 9:
                url = url9;
                unity = '元';
                disType = 'bar';
                disName = '商铺消费总金额';
                break;
            case 10:
                url = url10;
                unity = '张';
                disType = 'bar';
                disName = '领取优惠券数量';
                break;
            case 11:
                url = url11;
                unity = '张';
                disType = 'bar';
                disName = '优惠券使用数量';
                break;
            case 12:
                url = url12;
                unity = '张';
                disType = 'bar';
                disName = '领取停车券数量';
                break;
            case 13:
                url = url13;
                unity = '张';
                disType = 'bar';
                disName = '停车券使用数量';
                break;
            case 14:
                url = url14;
                unity = '次';
                disType = 'bar';
                disName = '停车车次';
                break;
            case 15:
                url = url15;
                unity = '元';
                disType = 'line';
                disName = '停车缴费金额';
                break;
            case 16:
                url = url16;
                unity = '次';
                disType = 'line';
                disName = '签到次数';
                break;
        }
        setData(time,url,container,unity,e,disType,disName);
    }

    /**
     * @param granularity   时间粒度
     * @param url   链接
     * @param container 容器
     * @param unity 单位
     * @param e 元素
     * @param type  类型
     */
    function setData(granularity,url,container,unity,e,type,disName) {
        if (null != e) {
            e.siblings().removeClass('btn-primary');
            e.siblings().addClass('btn-white');
            e.siblings().removeAttr('disabled');
            e.removeClass('btn-white');
            e.addClass('btn-primary');
            e.attr('disabled','disabled');
        }
        $.ajax({
            url: url,
            data: JSON.stringify({statisticalCycle:granularity}),
            type: 'POST',
            contentType: 'application/json'
        }).done(function (res) {
            // 基于准备好的dom，初始化echarts实例
            let myChart = echarts.init(document.getElementById(container));
            // 填入数据
            let xArray = [];
            let yArray = [];
            for (let key in res.data) {
                xArray.push(key);
                yArray.push(res.data[key]);
            }
            myChart.setOption({
                tooltip: {},
                xAxis: {
                    data: xArray
                },
                legend: {
                    data:[unity]
                },
                yAxis: {},
                series: [{
                    // 根据名字对应到相应的系列
                    name: disName,
                    type: type,
                    data: yArray
                }]
            });
        });
    }
</script>

</html>
